package com.sean.stock.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stock")
public class StockController {
    @Value("${server.port}")
    private String port;

    @RequestMapping("/reduce")
    public String reduce(){
        System.out.println("StockController: 扣减库存！");
        return "StockController: " + port;
    }

    @RequestMapping("/reduce2")
    public String reduce2(){
        int a = 1 / 0;
        System.out.println("StockController: 扣减库存！");
        return "StockController: " + port;
    }
}
